import {
  createRouter,
  createWebHashHistory,
  createWebHistory,
} from 'vue-router'
// import Home from '../views/Home.vue'
import Welcome from '../views/Welcome.vue'
import Home from '../views/Home.vue'
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/',
        name: 'Welcome',
        component: () => import('../views/Welcome.vue'),
      },
      {
        // 角色管理
        path: 'character',
        name: 'character',
        component: () => import('../components/character.vue'),
      },
      {
        // 部门管理
        path: 'department',
        name: 'department',
        component: () => import('../components/department.vue'),
      },
      {
        // 管理审批
        path: 'manager',
        name: 'manager',
        component: () => import('../components/manager.vue'),
      },
      {
        // 菜单管理
        path: 'menu',
        name: 'menu',
        component: () => import('../components/menu.vue'),
      },
      {
        // 权限审批
        path: 'right',
        name: 'right',
        component: () => import('../components/right.vue'),
      },
      {
        // 用户管理
        path: 'user',
        name: 'user',
        component: () => import('../components/user.vue'),
      },
    ],
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/About.vue'),
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
